#pragma once
#include <string>
#include <vector>
#include <map>

namespace DuiLib
{

	class UILIB_API CHitogramUI : public CControlUI
	{
		typedef std::map<CDuiString, int> StrIntMap;

	public:
		DECLARE_DUICONTROL(CHitogramUI)

	public:
		CHitogramUI(void) {}
		~CHitogramUI(void) {}

		bool AddCount(const CDuiString& name, int value);
		bool SetCount(const CDuiString& name, int value);
		bool Remove(const CDuiString& name);

	public:
		virtual void OnSetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue);
		virtual bool DoPaint(HDC hDC, const RECT& rcPaint, CControlUI* pStopControl);
		void DoPaintHitogram(HDC hDC, const RECT& rcPaint);

	private:
		StrIntMap m_items;

	};

}